from TABaseEvent import TABaseEvent

class ExitEvent(TABaseEvent):
    def __init__(self, msg='\nThanks for using Python TextAdventure!\n',
                                                               beforeExit=None):
        self.msg = msg

        if beforeExit:
            self.beforeExitHook = beforeExit

    def beforeExitHook(self):
        pass

    def __call__(self):
        print(self.msg)
        self.beforeExitHook()
        exit(0)
